<template>
  <div class="d-flex justify-content-between">
    <div
      v-for="item in hotBookList"
      :key="item.id"
      class="card mr-10"
      style="width: 12rem"
    >
      <div class="card-body d-flex align-items-center">
        <book :item="item" />
      </div>
    </div>
  </div>
</template>
<script>
import Book from "@/components/common/Book.vue";
export default {
  data() {
    return {
      hotBookList: [],
    };
  },
  components: {
    Book,
  },
  created() {
    // 原
    // this.axios.get("/api/book/new").then((res) => {
    //   console.log(res);
    //   this.hotBookList = res.data;
    // });

    this.axios.get("/api/book/new").then((res) => {
      console.log(res);
      if (res.data.code == 200) {
        this.hotBookList = res.data.data;
      }
    });
  },
};
</script>
